package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"path/filepath"
)

func main() {
	appendStr := filepath.Join("hello", "world")
	fmt.Println("appendStr:", appendStr)

	file, err := os.Open("./panic.go")
	if err != nil {
		fmt.Println(err)
	}
	reader := bufio.NewReader(file)
	for {
		string1, err := reader.ReadString('\n')
		defer file.Close()
		if err != nil {
			fmt.Println("错误err：为")
		}
		if err == io.EOF {
			fmt.Println("read over")
			break
		}
		fmt.Printf("read  is %s", string1)
	}
}
